package com.linkage.lcims.base.dao.business.impl;

import java.util.List;
import java.util.Map;

import com.linkage.lcims.base.dao.HibernateBaseDAOImpl;
import com.linkage.lcims.base.dao.business.interfaces.TollAttrPolicyDAO;
import com.linkage.lcims.base.po.business.BdTollAttrPolicy;
import com.linkage.util.exception.DAOException;

public class TollAttrPolicyDAOImpl extends HibernateBaseDAOImpl implements TollAttrPolicyDAO {

	private static final String PO_CLASS = "com.linkage.lcims.base.po.business.BdTollAttrPolicy";
	
	public TollAttrPolicyDAOImpl() {
		super();
	}
	
	public BdTollAttrPolicy getTollAttrPolicy(BdTollAttrPolicy bdTollAttrPolicy)
			throws DAOException {
		// TODO Auto-generated method stub
		return (BdTollAttrPolicy)this.getByID(BdTollAttrPolicy.class, bdTollAttrPolicy.getComp_id());
	}

	public void saveTollAttrPolicy(BdTollAttrPolicy bdTollAttrPolicy)
			throws DAOException {
		// TODO Auto-generated method stub
		this.save(bdTollAttrPolicy);
	}

	public void updateTollAttrPolicy(BdTollAttrPolicy bdTollAttrPolicy)
			throws DAOException {
		// TODO Auto-generated method stub
		this.merge(bdTollAttrPolicy);
	}

	public void deleteTollAttrPolicy(BdTollAttrPolicy bdTollAttrPolicy)
			throws DAOException {
		// TODO Auto-generated method stub
		this.delete(bdTollAttrPolicy);
	}

	public void updateFields(com.linkage.lcims.base.po.business.BdTollAttrPolicyPK id, Map<String,Object> fieldValues) throws DAOException {
		// TODO Auto-generated method stub
		this.updateField(PO_CLASS, id, fieldValues);
	}

	@SuppressWarnings("unchecked")
	public List<BdTollAttrPolicy> getAll() throws DAOException {
		// TODO Auto-generated method stub
		return super.getAll(BdTollAttrPolicy.class);
	}

//	public List<BdTollAttrPolicy> getTollAttrPolicyList(BdTollPolicy bdTollPolicy)
//			throws DAOException {
//		// TODO Auto-generated method stub
//		String hql = "from BdTollAttrPolicy as attrPolicy where attrPolicy.comp_id.policyid="+bdTollPolicy.getPolicyid();
//		return this.query(hql);
//	}

}
